*Figure 4

cd "/Users/kevin/Dropbox/TZ ITNs"
set more off
set varabbrev off

use "constructed data/for_analysis.dta", clear

cd "/Users/kevin/Dropbox/TZ ITNs/plots"

forvalues i=10(10)50 {
reg approve_vc1 i.zone post  if malaria`i'==1 & period_90==1 &  omitperiod==0, r cluster(dist_id)
estimates store malaria`i'
}


coefplot (malaria10, label("< 10%")) (malaria20, label("10-20%")) (malaria30, label("20-30%")) ///
(malaria40, label("30-40%")) (malaria50, label(">40%")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("VC approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "<10" .834 "10-20" 1 "20-30" 1.166 "30-40" 1.332 ">40", labs(small)) legend(off) xtitle("Prevalence category", size(medlarge))
graph save Graph "vc_prev_bw.gph", replace

forvalues i=10(10)50 {
reg approve_veo1 i.zone post  if malaria`i'==1 & period_90==1 &  omitperiod==0, r cluster(dist_id)
estimates store malaria`i'
}

coefplot (malaria10, label("< 10%")) (malaria20, label("10-20%")) (malaria30, label("20-30%")) ///
(malaria40, label("30-40%")) (malaria50, label(">40%")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("VEO approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "<10" .834 "10-20" 1 "20-30" 1.166 "30-40" 1.332 ">40", labs(small)) legend(off) xtitle("Prevalence category", size(medlarge))
graph save Graph "veo_prev_bw.gph", replace

forvalues i=10(10)50 {
reg approve_councillor1 i.zone post  if malaria`i'==1 & period_90==1 &  omitperiod==0, r cluster(dist_id)
estimates store malaria`i'
}

coefplot (malaria10, label("< 10%")) (malaria20, label("10-20%")) (malaria30, label("20-30%")) ///
(malaria40, label("30-40%")) (malaria50, label(">40%")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("Councillor approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "<10" .834 "10-20" 1 "20-30" 1.166 "30-40" 1.332 ">40", labs(small)) legend(off) xtitle("Prevalence category (%)", size(medlarge))
graph save Graph "councillor_prev_bw.gph", replace

forvalues i=10(10)50 {
reg approve_weo1 i.zone post  if malaria`i'==1 & period_90==1 &  omitperiod==0, r cluster(dist_id)
estimates store malaria`i'
}

coefplot (malaria10, label("< 10%")) (malaria20, label("10-20%")) (malaria30, label("20-30%")) ///
(malaria40, label("30-40%")) (malaria50, label(">40%")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("WEO approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "<10" .834 "10-20" 1 "20-30" 1.166 "30-40" 1.332 ">40", labs(small)) legend(off) xtitle("Prevalence category (%)", size(medlarge))
graph save Graph "weo_prev_bw.gph", replace

forvalues i=10(10)50 {
reg approve_mp1 i.zone post  if malaria`i'==1 & period_90==1 &  omitperiod==0, r cluster(dist_id)
estimates store malaria`i'
}

coefplot (malaria10, label("< 10%")) (malaria20, label("10-20%")) (malaria30, label("20-30%")) ///
(malaria40, label("30-40%")) (malaria50, label(">40%")), keep(post) rename(post="treatment effect") ///
vertical graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))  ciopts(lcolor(black)) mcolor(black) ///
title("MP approval") ylabel(-0.2(0.2)0.8) yscale(r(-0.2, 0.8)) ///
xlabel( .668 "<10" .834 "10-20" 1 "20-30" 1.166 "30-40" 1.332 ">40", labs(small)) legend(off) xtitle("Prevalence category (%)", size(medlarge))
graph save Graph "mp_prev_bw.gph", replace

graph combine "vc_prev_bw.gph" "veo_prev_bw.gph"  "councillor_prev_bw.gph" "weo_prev_bw.gph" "mp_prev_bw.gph", ///
  rows(2) cols(3) subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
